package org.airline.dao;

import java.util.List;

import org.airline.entity.PageBean;
import org.airline.entity.User;

public interface IUserDao {

	// 检测用户名是否已被注册
	public boolean checkUserName(String userName) throws Exception;

	// 检测邮箱是否已被注册
	public boolean checkEamil(String email) throws Exception;

	// 持久化用户
	public boolean saveUser(User user) throws Exception;

	// 检查用户是否存在
	public User checkUser(String userName, String password) throws Exception;

	// 检查管理是否存在
	public User checkAdminUser(String userName, String password)
			throws Exception;

	// 修改用户信息
	public void updateUser(User user) throws Exception;

	// 根据id获取用户信息
	public User getUserInfoById(int id) throws Exception;

	// 根据id删除用户信息
	public void deleteUserById(int id) throws Exception;

	// 根据关键字查询用户信息
	public List<User> getUsersByWords(String keyWord) throws Exception;

	// 查询所有用户信息
	public List<User> getAllUser() throws Exception;

	// 分页查询
	public PageBean queryForPage(int pageSize, int page) throws Exception;

	// 根据关键字分页查询
	public PageBean queryForPageByKeyWords(String keyWord, int pageSize,
			int page) throws Exception;
}
